﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcProject.Models.ProjectInfo>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    项目创建
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script src="../javascript/dateselect.js" type="text/javascript"></script>
    <script src="../javascript/dhtmlXCommon.js" type="text/javascript"></script>
    <script src="../javascript/dhtmlXTree.js" type="text/javascript"></script>
    <link href="../Themes/Css/FrameworkCss/dhtmlXTree.css" rel="stylesheet" type="text/css" />
    <h2>
        项目创建</h2>
    <% using (Html.BeginForm())
       {%>
    <%: Html.ValidationSummary(true) %>
    <fieldset>
        <legend>项目信息：</legend>
        <div class="editor-label">
            总包单位
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.TotalUnitName, new { style = "display:none" })%>
            <%: Html.TextBoxFor(model => model.TotalUnitId, new {style="display:none" })%>
            <%: Html.ValidationMessageFor(model => model.TotalUnitId) %>
            <div id="tree">
                <script type="text/javascript">
                    function TotalUnit_tonclick(id) {
                        $('#TotalUnitId').val(id);
                        $('#TotalUnitName').val(tree2.getItemText(id));
                    }
                    tree2 = new dhtmlXTreeObject("tree", "", "", 0);
                    tree2.setImagePath("../Images/tree/");
                    tree2.setOnClickHandler(TotalUnit_tonclick);
                    tree2.loadXMLString('<%=MvcProject.Utils.UC.TotalUnitTreeXml() %>');
                    window.setTimeout("tree2.openItem('OD000011')", 500);										
                </script>
            </div>
        </div>
        <div class="editor-label">
            分包单位
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.SubUnitName, new { style = "display:none" })%>
            <%: Html.TextBoxFor(model => model.SubUnitId, new { style = "display:none" })%>
            <%: Html.ValidationMessageFor(model => model.SubUnitId) %>
            <div id="tree1">
                <script type="text/javascript">
                    function SubUnit_tonclick(id) {
                        $('#SubUnitId').val(id);
                        $('#SubUnitName').val(tree3.getItemText(id));
                    }
                    tree3 = new dhtmlXTreeObject("tree1", "", "", 0);
                    tree3.setImagePath("../Images/tree/");
                    tree3.setOnClickHandler(SubUnit_tonclick);
                    tree3.loadXMLString('<%=MvcProject.Utils.UC.SubUnitTreeXml() %>');
                    //window.setTimeout("tree3.openItem('OD000011')", 500);										
                </script>
            </div>
        </div>
        <div class="editor-label">
            分包单位部门
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.SubUnitDepartmentId) %>
            <%: Html.ValidationMessageFor(model => model.SubUnitDepartmentId) %>
        </div>
        <div class="editor-label">
            工程类别*
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.ProjectTypeId) %>
            <%: Html.ValidationMessageFor(model => model.ProjectTypeId) %>
        </div>
        <div class="editor-label">
            项目名称*
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.ProjectName) %>
            <%: Html.ValidationMessageFor(model => model.ProjectName) %>
        </div>
        <div class="editor-label">
            工程地址*
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.ProjectAddress) %>
            <%: Html.ValidationMessageFor(model => model.ProjectAddress) %>
        </div>
        <div class="editor-label">
            项目金额
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.ProjectMoney) %>
            <%: Html.ValidationMessageFor(model => model.ProjectMoney) %>
        </div>
        <div class="editor-label">
            项目概述*
        </div>
        <div class="editor-field">
            <%: Html.TextAreaFor(model => model.ProjectNote) %>
            <%: Html.ValidationMessageFor(model => model.ProjectNote) %>
        </div>
        <div class="editor-label">
            项目状态*
        </div>
        <div class="editor-field">
            <%: Html.DropDownListFor(model => model.ProjectStatus,new SelectList(
                  new List<Object>{new { value = "在建" , text = "在建"  },new { value = "完成" , text = "完成" },new { value = "停工" , text = "停工"}},"value","text","在建")) %>
        </div>
        <div class="editor-label">
            项目负责人*
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.ProjectLeader) %>
            <%: Html.ValidationMessageFor(model => model.ProjectLeader) %>
        </div>
        <div class="editor-label">
            项目负责人身份证号*
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.PorjectLeaderCardId) %>
            <%: Html.ValidationMessageFor(model => model.PorjectLeaderCardId) %>
        </div>
        <div class="editor-label">
            技术负责人*
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.TechnologyLeader) %>
            <%: Html.ValidationMessageFor(model => model.TechnologyLeader) %>
        </div>
        <div class="editor-label">
            技术负责人身份证号*
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.TechnologyLeaderCardId) %>
            <%: Html.ValidationMessageFor(model => model.TechnologyLeaderCardId) %>
        </div>
        <div class="editor-label">
            安全负责人*
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.SecurityLeader) %>
            <%: Html.ValidationMessageFor(model => model.SecurityLeader) %>
        </div>
        <div class="editor-label">
            安全负责人身份证号*
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.SecurityLeaderCardId) %>
            <%: Html.ValidationMessageFor(model => model.SecurityLeaderCardId) %>
        </div>
        <div class="editor-label">
            资料负责人*
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.DataLeader) %>
            <%: Html.ValidationMessageFor(model => model.DataLeader) %>
        </div>
        <div class="editor-label">
            资料负责人身份证号*
        </div>
        <div class="editor-field">
            <%: Html.TextBoxFor(model => model.DataLeaderCardId) %>
            <%: Html.ValidationMessageFor(model => model.DataLeaderCardId) %>
        </div>
        <p>
            <input type="submit" value="创建项目" />
        </p>
    </fieldset>
    <% } %>
    <div>
        <%: Html.ActionLink("返回项目列表", "Index") %>
    </div>
</asp:Content>
